package com.codefish.framework.spring.beans.factory.config;

import com.codefish.framework.spring.beans.factory.IBeanFactory;
import com.codefish.framework.spring.beans.factory.support.ISingletonBeanRegistry;
import com.codefish.framework.spring.util.IStringValueResolver;

/**
 * 可配置的beanFactory接口
 *
 * @author <a href='https://gitee.com/hzf2281'>codefish</a>
 * @version 1.0.0
 * @since 2022/10/03 下午 03:22
 */
public interface IConfigurableBeanFactory extends IBeanFactory, ISingletonBeanRegistry {
    /**
     * scope标识，标识单例的bean
     */
    String SCOPE_SINGLETON = "singleton";
    /**
     * scope标识，标识原型的bean
     */
    String SCOPE_PROTOTYPE = "prototype";

    /**
     * 解析传入的字符串值
     * @param value 准备解析的值
     * @return  解析结果，可能为自身
     */
    String resolveEmbeddedValue(String value);

    /**
     * 添加字符串值解析器
     * @param stringValueResolver 指定的StringValueResolver
     */
    void addStringValueResolver(IStringValueResolver stringValueResolver);

    /**
     * 添加BeanPostProcessor
     *
     * @param beanPostProcessor 要添加的beanPostProcessor
     */
    void addBeanPostProcessor(IBeanPostProcessor beanPostProcessor);

    /**
     * 销毁所有的单例bean
     */
    void destroySingletons();


}
